package com.keyinong.parkin.alipush;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

import com.example.parkin.R;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class InputAreaRegioService extends Service {
     String inputContent="";
	
	
	@Override
	public IBinder onBind(Intent intent) {
		Log.e("lh", "Service--onBind");
		return null;
	}
	public class MyAreaRegioBinder extends Binder{
		public InputAreaRegioService getservice() {
			return InputAreaRegioService.this;
		}
		
	}
	public String startInput(){
		InputStream inputStream=getResources().openRawResource(R.raw.region);
		try {
			InputStreamReader ireader=new InputStreamReader(inputStream, "UTF-8");
			BufferedReader bReader=new BufferedReader(ireader);
			String info="";
			while ((info=bReader.readLine())!=null) {
				inputContent=info;
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return inputContent;
	}

	@Override
	public void onCreate() {
		Log.e("lh", "Service--onCreate");
		super.onCreate();
	}

	@Override
	public void onDestroy() {
		Log.e("lh", "Service--onDestroy");
//		super.onDestroy();
	}
	

}
